projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a9115e
)
net: davinci_emac: fix NULL check after pointer dereference
author
Vishwas Srivastava
<
[email protected]
>
Tue, 26 Jan 2016 07:16:42 +0000
(12:46 +0530)
committer
Anatolij Gustschin
<
[email protected]
>
Sat, 6 Feb 2016 15:39:31 +0000
(16:39 +0100)
NULL check is made after the pointer dereference. This patch
fixes this issue.
Signed-off-by: Vishwas Srivastava <
[email protected]
>
CC: Joe Hershberger <
[email protected]
>
Reviewed-by: Tom Rini <
[email protected]
>
Acked-by: Joe Hershberger <
[email protected]
>
Signed-off-by: Anatolij Gustschin <
[email protected]
>
drivers/net/davinci_emac.c
patch
|
blob
|
history
diff --git
a/drivers/net/davinci_emac.c
b/drivers/net/davinci_emac.c
index 6f2dc8d64882dc72ded605fae3f17215066ca836..b03049840286339384d4358fc46f15af66c78ac0 100644
(file)
--- a/
drivers/net/davinci_emac.c
+++ b/
drivers/net/davinci_emac.c
@@
-692,8
+692,10
@@
static int davinci_eth_rcv_packet (struct eth_device *dev)
davinci_invalidate_rx_descs();
rx_curr_desc = emac_rx_active_head;
+ if (!rx_curr_desc)
+ return 0;
status = rx_curr_desc->pkt_flag_len;
- if ((
rx_curr_desc) && ((status & EMAC_CPPI_OWNERSHIP_BIT) == 0)
) {
+ if ((
status & EMAC_CPPI_OWNERSHIP_BIT) == 0
) {
if (status & EMAC_CPPI_RX_ERROR_FRAME) {
/* Error in packet - discard it and requeue desc */
printf ("WARN: emac_rcv_pkt: Error in packet\n");